//
//  CompGraf2ViewController.h
//  CompGraf2
//
//  Created by Juan Niosi on 02/08/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#import <OpenGLES/EAGL.h>

#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>

#import "Engine.h"
#import "OrbitCam.h"
#import "TransformObject.h"
#import "Terrain.h"
#import "MD2Model.h"
#import "CharacterController.h"
#import "World.h"

@interface CompGraf2ViewController : UIViewController <UIGestureRecognizerDelegate>
{
    EAGLContext *context;
    GLuint program;
    
    World *world;
    
    BOOL animating;
    NSInteger animationFrameInterval;
    CADisplayLink *displayLink;
    Engine *engine;
    CGFloat lastScale;
    
    UIPanGestureRecognizer *panGR;
    UIPinchGestureRecognizer *pinchGR;
    UITapGestureRecognizer *tapGR;
    
    NSMutableArray *md2Models;
    TransformObject *md2ModelTransform;
}

@property (readonly, nonatomic, getter=isAnimating) BOOL animating;
@property (nonatomic) NSInteger animationFrameInterval;

- (void)startAnimation;
- (void)stopAnimation;
- (void)onMove:(UIPanGestureRecognizer *)sender;
- (void)onMove2:(UIPanGestureRecognizer *)sender;
- (void)onPinch:(UIPinchGestureRecognizer *)sender;
- (void)onTap:(UITapGestureRecognizer *)sender;
@end
